package com.bytezero.homeworkday09.mapper;

import com.bytezero.homeworkday09.bean.Student;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @Author: Bytezero_zhengLei
 * @Date: 2024/6/30 21:29
 * @Project_Name:
 * @Email: 420498246@qq.com
 * @Description:
 * @TODO:
 */

@Mapper
public interface StudentMapper {

    @Insert("insert into student (id,name,no,gender,phone,degree,violation_count,violation_score,class_id,create_time,update_time) values(" + " #{id},#{name},#{no},#{gender},#{phone},#{degree},#{violationCount},#{violationScore},#{classId},#{createTime},#{updateTime}) ")

    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    public abstract void InsertStudent(Student student);


    @Select("select * from student where id = #{id}")
    public abstract Student selectStudentId(@Param("id")Integer id);


    void UpdateStudent(Student stu);

     List<Student> conditionSelect(@Param("name") String name,
                                   @Param("no")String no,
                                   @Param("degree") Integer degree,
                                   @Param("classId") Integer classId);




}
